﻿<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="PhongEdit.aspx.cs" Inherits="PhongEdit" Title="Phong Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Phòng - Thêm/Chỉnh sửa</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="PhongId" runat="server" DataSourceID="PhongDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/PhongFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/PhongFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>Phong not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Thêm" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Cập nhật" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Bỏ qua" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:PhongDataSource ID="PhongDataSource" runat="server"
			SelectMethod="GetByPhongId"
		>
			<Parameters>
				<asp:QueryStringParameter Name="PhongId" QueryStringField="PhongId" Type="String" />

			</Parameters>
		</data:PhongDataSource>
		
		<br />

		<data:EntityGridView ID="GridViewVe1" runat="server"
			AutoGenerateColumns="False"	
			OnSelectedIndexChanged="GridViewVe1_SelectedIndexChanged"			 			 
			DataSourceID="VeDataSource1"
			DataKeyNames="VeId"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_Ve.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<asp:BoundField DataField="TenVe" HeaderText="Ten Ve" SortExpression="[TenVe]" />				
				<asp:BoundField DataField="MoTa" HeaderText="Mo Ta" SortExpression="[MoTa]" />				
				<asp:BoundField DataField="TrangThai" HeaderText="Trang Thai" SortExpression="[TrangThai]" />				
				<data:HyperLinkField HeaderText="Loai Ve Id" DataNavigateUrlFormatString="LoaiveEdit.aspx?LoaiVeId={0}" DataNavigateUrlFields="LoaiVeId" DataContainer="LoaiVeIdSource" DataTextField="TenVe" />
				<data:HyperLinkField HeaderText="Rap Id" DataNavigateUrlFormatString="RapEdit.aspx?RapId={0}" DataNavigateUrlFields="RapId" DataContainer="RapIdSource" DataTextField="TenRap" />
				<data:HyperLinkField HeaderText="Phong Id" DataNavigateUrlFormatString="PhongEdit.aspx?PhongId={0}" DataNavigateUrlFields="PhongId" DataContainer="PhongIdSource" DataTextField="TenPhong" />
				<data:HyperLinkField HeaderText="Phim Id" DataNavigateUrlFormatString="PhimEdit.aspx?PhimId={0}" DataNavigateUrlFields="PhimId" DataContainer="PhimIdSource" DataTextField="TenPhim" />
				<data:HyperLinkField HeaderText="Ghe Id" DataNavigateUrlFormatString="GheEdit.aspx?GheId={0}" DataNavigateUrlFields="GheId" DataContainer="GheIdSource" DataTextField="TenGhe" />
				<asp:BoundField DataField="Gia" HeaderText="Gia" SortExpression="[Gia]" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No Ve Found! </b>
				<asp:HyperLink runat="server" ID="hypVe" NavigateUrl="~/admin/VeEdit.aspx">Add New</asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:VeDataSource ID="VeDataSource1" runat="server" SelectMethod="Find"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:VeProperty Name="Ghe"/> 
					<data:VeProperty Name="Loaive"/> 
					<data:VeProperty Name="Phim"/> 
					<data:VeProperty Name="Phong"/> 
					<data:VeProperty Name="Rap"/> 
					<%--<data:VeProperty Name="LichSuGdkhCollection" />--%>
					<%--<data:VeProperty Name="UserIdUserCollection_From_LichSuGdkh" />--%>
				</Types>
			</DeepLoadProperties>
			
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:VeFilter  Column="PhongId" QueryStringField="PhongId" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:VeDataSource>		
		
		<br />
		

</asp:Content>

